package team.hyznrj.studentsys.exception;

import lombok.Getter;
import lombok.NoArgsConstructor;
import team.hyznrj.studentsys.enums.AccountEnum;

/**
 * @author ReMidDream
 * @date 2018-04-23 16:00
 **/
@Getter
@NoArgsConstructor
public class AccountException extends RuntimeException{

    private Integer code;

    public AccountException(AccountEnum accountEnum) {
        super(accountEnum.getMessage());
        this.code = accountEnum.getCode();
    }

    public AccountException(Integer code,String message) {
        super(message);
        this.code = code;
    }
}
